package com.pureut.scheduling.mapper;

import com.pureut.production.api.domain.PublicScheduling;
import com.pureut.scheduling.domain.BackWeight;
import com.pureut.scheduling.domain.SchedulingExecutionOn;
import com.pureut.scheduling.domain.SchedulingProduction;
import com.pureut.scheduling.domain.dto.ProductionMaterialDto;
import com.pureut.scheduling.domain.dto.SchedulingExecutionDto;
import com.pureut.scheduling.domain.dto.SchedulingProductionDto;
import com.pureut.scheduling.domain.vo.*;

import java.util.List;

/**
 * @Description
 * @Param
 * @Date
 * @Author hl
 **/
public interface SchedulingProductionMapper {

    /**
     * 生产排程查看
     */
    List<SchedulingProductionDto> selectProductionList(SchedulingProductionVo schedulingProductionVo);

    /**
     * 手动下达
     */
    int insertSchedulingManual(SchedulingExecutionOn schedulingExecutionVo);

    /**
     * 下达排程单集合
     */
    List<SchedulingExecutionDto> selectSchedulingExecution(SchedulingExecutionVo dto);

    /**
     * 下达排程单删除
     */
    int deleteExecutionById(long executionId);

    /**
     * 修改重量
     */
    int updateProductionWeight(String code, double we);

    /**
     * 查询单个
     */
    ProductionMaterialDto selectProductionById(long productionId);

    /**
     * 根据id找到该线别最大的完工时间
     */
    String getStartWork(long lineId);

    /**
     * 排程确认
     */
    int confirmSchedulingExecution(long executionId);

    /**
     * 预排程单新增
     */
    int insertSchedulingProduct(SchedulingProduction production);

    /**
     * 排程单查询(下达)
     */
    List<SchedulingExecutionDto> selectSchedulingExecutionList(SchedulingExecutionVo schedulingExecutionVo);

    /**
     * T+N锁定
     */
    int insertSchedulingLock(SchedulingLockVo schedulingLockVo);

    /**
     *拖动甘特图修改开工以及完工时间
     */
    int ganttChartEdit(GanttChartVo ganttChartVo);

    /**
     *查询排程信息
     */
    PublicScheduling selectExecutionById(long executionId);

    /**
     *排程确认后增加预排程单的已排程重量
     */
    void updateProductionWeightAdd(String productionCode, double planWeight);

    /**
     *查询排程最大的流水号
     */
    int maxSchedulingProduct(String cStr);

    String maxSchedulingManual(String cStr);

    int updateBackAdjust(BackAdjustVo backAdjustVo);

    int updateBackWeight(BackWeight backWeight);

    int updateBackWeightDelete(BackWeight backWeight);

    /**
     * 根据生产计划id获取生产排程详情
     */
    SchedulingProductionDto getProductionView(long planId);

    boolean updateProductStatus(long productionId);

    /**
     * 根据编码获取数据
     */
    SchedulingProductionDto getViewByProductionCode(String productionCode);
}
